#pragma once
#include "InterFaceComposite.h"
#include <QString>


class CompositeComponent : public Composite
{
public:
    CompositeComponent(QString strName);
    ~CompositeComponent();


public:

    // 通过 Leaf 继承
    void operation() override;

    // 通过 Composite 继承
    void Add(std::shared_ptr<Component> c) override;
    void Remove(std::shared_ptr<Component> c) override;
    std::shared_ptr<Component> GetChild(size_t index) override;

private:

    //节点容器;
    std::vector<std::shared_ptr<Component>> m_listComponent;

    //节点名称;
    QString m_strName;
};

